<template>
    <div class="Father">
        <h2>父组件</h2>
        <h3 v-show="toy">儿子给的玩具：{{toy }}</h3>
        <Son :che="car" :sendToy="getToy"/>
    </div>
</template>

<script lang="ts" setup name="Father">
    import Son from "./Son.vue"
    import {ref} from "vue"

    //数据
    let car = ref("奔驰")
    let toy = ref('')
    //方法
    function getToy(value:string){
        toy.value = value
    }
</script>

<style scoped>
.Father{
    background-color: skyblue;
    height: 400px;
}
</style>